home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 13 / FreelogHS13.iso / P To P / eMule0.24b-sivka.v4b1-bin / Webserver / tab.js < prev    next >
Text File  |  2003-01-09  |  1KB  |  52 lines

  1. var oTab=new Array();
  2.  
  3. function createTab(x,y,width,height)
  4. {
  5.   var num=oTab.length;
  6.   num++;
  7.  
  8.   var str='<div id="divTab'+num+'" class="clTab">test</div>';
  9.   alert(str);
  10.   document.write(str);
  11.  
  12.   oTab[num]=new lib_obj('divTab'+num,"","","",num);
  13.   oTab[num].id=num;
  14.   oTab[num].x=x;
  15.   oTab[num].y=y;
  16.   oTab[num].width=width;
  17.   oTab[num].height=height;
  18.   oTab[num].listtext=new Array();
  19.   oTab[num].listjs=new Array();
  20.   oTab[num].show=showTab;
  21.   oTab[num].addElement=addTabElement;
  22.   oTab[num].clearElement=clearTabElement;
  23.   oTab[num].setContent=setContent;
  24.   oTab[num].moveIt(x,y);
  25.   oTab[num].showIt();
  26.   return oTab[num];
  27. }
  28.  
  29. function showTab()
  30. {
  31.   var count=this.listtext.length;
  32.   var str='<table class="clTab" border="1"><tr>';
  33.   for(index=0;index<count;index++)
  34.   {
  35.     str+='<td onClick="'+this.listjs[index]+'">'+this.listtext[index]+'</td>';
  36.   }
  37.   str+="</tr></table>";
  38.   alert(str);
  39.   this.setContent(str,"divTab"+this.id);
  40. }
  41.  
  42. function addTabElement(text,js)
  43. {
  44.   this.listtext.push(text);
  45.   this.listjs.push(js);
  46. }
  47.  
  48. function clearTabElement()
  49. {
  50.   this.listtext=new Array();
  51.   this.listjs=new Array();
  52. }